<html>
<head>
    <title>Результат загрузки файла</title>
    <meta charset="UTF-8">
</head>
<body>
<?php
require_once "Context.php";

    if ($_FILES["Image"]["size"] > 1024 * 3 * 1024) {
        echo("Размер файла превышает три мегабайта");
        exit;
    }
    if (is_uploaded_file($_FILES["Image"]["tmp_name"])) {
        move_uploaded_file($_FILES["Image"]["tmp_name"], "../images/" . $_FILES["Image"]["name"]);
        $ProductName = $_POST['Product_title'];
        echo $ProductName;
        $ImageName = $_FILES["Image"]["name"];
        echo $ImageName;
        $Product_file_size = $_POST['Product_file_size'];
        echo $Product_file_size;
        $Product_Requirements = $_POST['Product_Requirements'];
        echo $Product_Requirements;
        $Product_Languages = $_POST['Product_Languages'];
        echo $Product_Languages;
        $Product_Date = $_POST['Product_Date'];
        echo $Product_Date;
        $Product_Author = $_POST['Product_Author'];
        echo $Product_Author;
        $Product_Page = $_POST['Product_page'];
        echo $Product_Page;
        $Product_Description_preview = $_POST['Product_Description_preview'];
        echo $Product_Description_preview;
        $Product_Description = $_POST['Product_Description'];
        echo $Product_Description;
        $CategoryId = $_POST['CustomCategoryId'];
        echo $CategoryId;



        /*$result = Context::DB()->query("INSERT INTO `Products`(`TItle`, `Image`, `File_size`, `Requirements`, `Languages`, `Date_added`, `Author`, `Homepage`, `Description_preview`,`Description`, `CategoryId`) VALUES ('$ProductName','$ImageName','$Product_file_size','$Product_Requirements','$Product_Languages','$Product_Date','$Product_Author','$Product_Page','$Product_Description_preview','$Product_Description','$CategoryId')");
        echo $result;*/
    }

?>
</body>
</html>